Databento two-stage price producer + per-symbol provider selection (ADR-0006)#39
Merged
Conversation
Implements ADR-0006 (one price provider per symbol) so a server without Norgate can build the price store from Databento. - registry: databento capability mapping + optional price_source override; resolve_source()/default_price_source() (COTDATA_PRICE_SOURCE); softs/lumber/MSCI marked non-GLBX with Yahoo fallback tickers. - databento provider: two-stage ingest (paid, append-only raw store, resumable) + build (free, additive back-adjustment; roll detection via instrument_id; settlement stat_type 3; OI stat_type 9). - yfinance: deployment-aware target selection via resolve_source. - update.py: --ingest-databento / --build-databento flags. - scripts/validate_databento_vs_norgate.py: Norgate-parity harness. - README + pyproject docs; 16 new/updated tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements ADR-0006 so a server without Norgate can build the price store from Databento. Consumers (cotmetrics, cot-analyzer) are unchanged — they still read the store.
Per-symbol provider selection
databentocapability mapping + optionalprice_sourceoverride in the registry.resolve_source()/default_price_source()(COTDATA_PRICE_SOURCE): deployment default + capability + yfinance fallback. The yfinance producer is now deployment-aware.Databento producer (two stages)
--ingest-databento(paid): raw.n.0/.n.1ohlcv-1d+statisticsinto an append-only, resumable raw store (producer-internal).--build-databento(free): additive back-adjustment matching Norgate's method (gap =n1 − n0on each roll date, shifted back-to-front so the newest segment stays at real prices), settlement close (stat_type 3), OI (stat_type 9). Roll detection keys oninstrument_id(thesymbolcolumn is a constant continuous alias).Validation & docs
scripts/validate_databento_vs_norgate.pyparity harness (unit-tested on synthetic frames).Verified on live ES/CL/GC (65/80/235 rolls; daily changes preserved off-seam, newest segment anchored to real prices, no non-positive closes). Also carries the CFTC
format='mixed'date-parse hardening + a future-date sanity guard.cotdata: 110 tests green.
🤖 Generated with Claude Code